<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //利用array filter及indexOf数组去重
        var arr1 = [1,2,2,3,3,4,5,6];
        console.log(arr1);
        console.log("去重");
        var arr2 = arr1.filter(function (item,index,arr) {
            return arr.indexOf(item) === index;
        })
        console.log(arr2);
    </script>
</head>
<body>

</body>
</html>